package com.ruyuan.eshop.seller.controller.seller.trade;

import com.ruyuan.eshop.common.domain.vo.InvoiceVO;
import com.ruyuan.eshop.common.service.trade.order.OrderQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 发货单控制器
 *
 * @author pwd
 * @version 1.0
 */
@Api(description = "发货单API")
@RestController
@RequestMapping("/api/trade/invoice")
@Validated
public class InvoiceSellerController {

    @Autowired
    private OrderQueryService orderQueryService;

    /**
     * 查询发货单信息
     * @param orderId 订单ID
     * @return
     */
    @ApiOperation(value = "查询发货单信息")
    @GetMapping
    public InvoiceVO create(@RequestParam(value = "order_id")  Long orderId) {
        return this.orderQueryService.getInvoice(orderId);
    }


}
